package WordCounter;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class WordCounter {
	
		/**
		 * @param args
		 * @throws IOException 
		 */
		public static void main(String[] args) throws IOException {
			String word = "";
			int count = 0;

			BufferedReader infile = new BufferedReader(new FileReader(args[0]));
			word = infile.readLine();
			
			while(word != null){
				count++;
				word = infile.readLine();
			}
			
			System.out.println("The number of words - " + count);
		}

	}

